"use client"
import {
    Navbar,
    NavbarBrand,
    NavbarContent,
    NavbarItem,
    Link,
    Button
} from "@nextui-org/react";
import { useRouter } from 'next/navigation'
import { AppstoreOutlined, MailOutlined, GlobalOutlined, FileUnknownOutlined } from '@ant-design/icons';
import { Menu } from 'antd';
import {AcmeLogo} from '@/assets/svgs/icons'
import styles from './home.module.css';

const items = [
    {
        label: '方案',
        key: 'home',
        icon: <MailOutlined />,
    },
    {
        label: '产品',
        key: 'products',
        icon: <AppstoreOutlined />,
        disabled: false,
        children: [
            {
                label: '充电桩专区',
                key: 'piles',
                children: [
                    {
                        label: '直流超充',
                        key: 'superDCPile',
                    },
                    {
                        label: '直流快充',
                        key: 'fastDCPile',
                    },
                    {
                        label: '交流慢充',
                        key: 'acPile',
                    },
                ],
            },
            {
                label: '储能专区',
                key: 'example',
            },
        ],
    },
    {
        label: '资源',
        key: 'source',
        icon: <GlobalOutlined />,
        children: [
            {
                type: 'apply',
                label: '供应商资源',
                children: [
                    {
                        label: '模块供应商',
                        key: 'modeApply',
                    },
                    {
                        label: '柜体供应商',
                        key: 'boxApply',
                    },
                    {
                        label: '枪线供应商',
                        key: 'gunLineApply',
                    },
                ],
            },
            {
                type: 'users',
                label: '客户资源',
                children: [
                    {
                        label: '重卡单位',
                        key: 'truckUser',
                    },
                    {
                        label: '物流公司',
                        key: 'logisticsUser',
                    },
                    {
                        label: '出租车/网约车',
                        key: 'taxiUser',
                    },
                ],
            },
        ],
    },
    {
        label: '文档',
        key: 'doc',
        icon: <FileUnknownOutlined />,
        disabled: true,
    },
];
// export const AcmeLogo = () => {
//     return (
//         <svg fill="none" height="36" viewBox="0 0 32 32" width="36">
//             <path
//                 clipRule="evenodd"
//                 d="M17.6482 10.1305L15.8785 7.02583L7.02979 22.5499H10.5278L17.6482 10.1305ZM19.8798 14.0457L18.11 17.1983L19.394 19.4511H16.8453L15.1056 22.5499H24.7272L19.8798 14.0457Z"
//                 fill="currentColor"
//                 fillRule="evenodd"
//             />
//         </svg>
//     );
// };
export default function App() {
    const router = useRouter();
    console.log('路由', router);
    return (
        <Navbar className={styles.navHead}>
            <NavbarBrand className={styles.logoDiv}>
                {/*<Image src='/images/logo3.png' alt='Long' style={{display: 'inline-block', width: '70px', height: '70px'}}/>*/}
                <AcmeLogo />
                <p className="font-bold text-inherit">Long</p>
            </NavbarBrand>
            <NavbarContent justify="start" className={styles.menuDiv}>
                <Menu style={{backgroundColor: 'transparent', border: 'none'}}  mode="horizontal" items={items} onClick={(e) =>{
                    router.push(`/${e.key}?ID=1`);
                    console.log('菜单点击', e)
                }} />
            </NavbarContent>
            <NavbarContent justify="end" className={styles.loginDiv}>
                <NavbarItem className="hidden lg:flex">
                    <Link href="#" onClick={() => router.push('/login')}>
                        登录
                    </Link>
                </NavbarItem>
                <NavbarItem>
                    <Button
                        as={Link}
                        color="primary"
                        variant="flat"
                        onClick={() => router.push('/signup')}
                    >
                        注册
                    </Button>
                </NavbarItem>
            </NavbarContent>
        </Navbar>
    );
}
